package net.huashitong.Indicators.service;

import java.text.DecimalFormat;
import java.text.ParseException;
import java.util.*;

import net.huashitong.Indicators.databean.CompletionClassificationDatabean;
import net.huashitong.Indicators.databean.IndicatorBreakdownDatabean;
import net.huashitong.Indicators.entity.CompletionClassification;
import net.huashitong.Indicators.entity.IndicatorBreakdown;
import net.huashitong.Indicators.entity.TertiaryIndustry;
import net.huashitong.Indicators.filter.IndicatorBreakdownFilter;
import net.huashitong.Indicators.utils.CodeUtils;
import net.huashitong.Indicators.utils.Comparators;
import net.huashitong.Indicators.utils.ComparatorsUtils;
import net.huashitong.Indicators.utils.DataUtils;
import net.huashitong.Indicators.utils.DateForIndUtils;
import net.huashitong.Indicators.utils.IndustryNameUtils;

import net.huashitong.scheduling.databean.IndicatorSchedulingDatabean;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.sirdc.modules.utils.ObjectUtils;
import com.sirdc.modules.utils.StringUtils;

@Service
public class SolidInvestmentService {
	@Autowired
	private IndicatorBreakdownService breakdownService;
	@Autowired
	private CompletionClassificationService classificationService;
	@Autowired
	private TertiaryIndustryService industryService;
	@Autowired
	private TertiaryIndustryService tertiaryIndustryService;

	private static Logger logger = LoggerFactory.getLogger(SolidInvestmentService.class);
	/**
	 * 图一
	 * @param filter
	 * @return
	 */
	public Map<String, Object> queryCountyRankThi(
			IndicatorBreakdownFilter filter) {
		filter = IndustryNameUtils.changeName(filter);
		TertiaryIndustry industry = tertiaryIndustryService.getById(filter.getIndustryId());
		Map<String, Object> map = new HashMap<String, Object>();
		List<IndicatorBreakdown> lists = breakdownService.queryCountyRank(filter);
		List<IndicatorBreakdownDatabean> databeans = new ArrayList<IndicatorBreakdownDatabean>();
		DecimalFormat df=new DecimalFormat("#.##");
		for (IndicatorBreakdown indicatorBreakdown : lists) {
			List<IndicatorBreakdownDatabean> breakdownDatabeans = new ArrayList<IndicatorBreakdownDatabean>();
			IndicatorBreakdownDatabean databean = new IndicatorBreakdownDatabean();
			if(IndustryNameUtils.RealOutForeignIndexId.equals(filter.getIndustryId())){
				String st=df.format(Double.parseDouble(indicatorBreakdown.getCumulative()));
				databean.setRightValue(st);
			}else {
				String st=df.format(Double.parseDouble(indicatorBreakdown.getCumulative())/10000);
				databean.setRightValue(st);
			}
			breakdownDatabeans.add(databean);
			databean = new IndicatorBreakdownDatabean();
			databean.setRightValue(df.format(Double.parseDouble(indicatorBreakdown.getRatio())));
			breakdownDatabeans.add(databean);
			databean = new IndicatorBreakdownDatabean();
			databean.setLeftValue(indicatorBreakdown.getArea());
			databean.setRightdata(breakdownDatabeans);
			databeans.add(databean);
		}
		String oneTitle = "";
		if(CodeUtils.monthOrQuarter_mon.equals(filter.getMonthOrQuarter())){
			if("A18".equals(filter.getIndustryId())||"A19".equals(filter.getIndustryId())){
				oneTitle = "累计至当月完成(万元)";
			}else{
				oneTitle = "累计至当月完成("+industry.getUnit()+")";
			}
			
		}else {
			if("A18".equals(filter.getIndustryId())||"A19".equals(filter.getIndustryId())){
				oneTitle = filter.getCurrentMonth().substring(2,4)+"年1-"+filter.getCurrentMonth().substring(filter.getCurrentMonth().length()-2)+"月季度完成值(万元)";
			}else{
			oneTitle = filter.getCurrentMonth().substring(2,4)+"年1-"+filter.getCurrentMonth().substring(filter.getCurrentMonth().length()-2)+"月季度完成值("+industry.getUnit()+")";
			}
		}
		map.put("data", databeans);
		map.put("title", industry.getIndicatorName()+"各县市排名");
		map.put("firTitle", "县市");
		List<Map<String, String>> secTitle = new ArrayList<Map<String, String>>();
		Map<String, String> map2 = new HashMap<String, String>();
		String twoTitle = "同比增长率(%)";
		map2.put("column", oneTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", twoTitle);
		secTitle.add(map2);
		map.put("secTitle", secTitle);
		return map;
	}
	/**
	 * 图三
	 * @param filter
	 * @return
	 * @throws ParseException
	 */
	public Map<String, Object> queryMonthAbsoluteThi(
			IndicatorBreakdownFilter filter) throws ParseException {
		List<IndicatorBreakdownDatabean> breakdownDatabeans = new ArrayList<IndicatorBreakdownDatabean>();
		String oneTitle = "";
		String twoTitle = "";
		String title = "";
		filter = IndustryNameUtils.changeName(filter);
		TertiaryIndustry industry = tertiaryIndustryService.getById(filter.getIndustryId());
		if(CodeUtils.monthOrQuarter_mon.equals(filter.getMonthOrQuarter())){
			oneTitle = "当月绝对值("+industry.getUnit()+")";
			twoTitle = "当月同比增长率(%)";
			title = industry.getIndicatorName()+"各月绝对值及同比增长情况";
			breakdownDatabeans = getMonthValue(filter);
		}else {
			oneTitle = "当季绝对值("+industry.getUnit()+")";
			twoTitle = "当季同比增长率(%)";
			title = industry.getIndicatorName()+"各季度绝对值及同比增长情况";
			breakdownDatabeans = getQuarterValue(filter);
		}
		Map<String, Object> map = new HashMap<String, Object>();
		List<Map<String, String>> secTitle = new ArrayList<Map<String, String>>();
		Map<String, String> map2 = new HashMap<String, String>();
		map.put("title", title);
		map.put("firTitle", "时间");
		map2.put("column", oneTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", twoTitle);
		secTitle.add(map2);
		map.put("secTitle", secTitle);
		map.put("data", breakdownDatabeans);
		return map;
	}
	/**
	 * 获取第三张图季度数据
	 * @param filter
	 * @return
	 * @throws NumberFormatException 
	 * @throws ParseException
	 */
	private List<IndicatorBreakdownDatabean> getQuarterValue(
			IndicatorBreakdownFilter filter) throws NumberFormatException, ParseException {
		filter = IndustryNameUtils.changeName(filter);
		filter.setDate(DateForIndUtils.getNextYearDate(filter.getDate().substring(0,4),0));
		List<IndicatorBreakdown> breakdowns = breakdownService.queryAbsoluteValue(filter);
		List<IndicatorBreakdownDatabean> breakdownDatabeans = new ArrayList<IndicatorBreakdownDatabean>();
		breakdownDatabeans = DataUtils.detailData(breakdowns,breakdownDatabeans);
		filter.setDate(DateForIndUtils.getNextYearDate(filter.getDate(),-1));
		List<IndicatorBreakdown> breakdownSs = breakdownService.queryAbsoluteValue(filter);
		breakdownDatabeans = DataUtils.detailData(breakdownSs,breakdownDatabeans);
		filter.setDate(DateForIndUtils.getNextYearDate(filter.getDate(),-1));
		breakdownSs = breakdownService.queryAbsoluteValue(filter);
		breakdownDatabeans = DataUtils.detailData(breakdownSs,breakdownDatabeans);
		List<IndicatorBreakdownDatabean> breakdownDatabeans3 = new ArrayList<IndicatorBreakdownDatabean>();
		for (IndicatorBreakdownDatabean breakdownDatabean : breakdownDatabeans) {
			List<IndicatorBreakdownDatabean> databeans = new ArrayList<IndicatorBreakdownDatabean>();
			IndicatorBreakdownDatabean breakdownDatabean2 = new IndicatorBreakdownDatabean();
			if(breakdownDatabean.getCurrentMonth().substring(0,4).contains(filter.getDate())){
				continue;
			}
			DecimalFormat df=new DecimalFormat("#.##");
			String st = "";
			Double double5 = Double.parseDouble(breakdownDatabean.getSeasonsComparison());
			if(breakdownDatabean.getCurrentMonth().contains("02")){
				double5  = double5/2;
				st=df.format(double5/10000);
				breakdownDatabean2.setRightValue(st);
			}else {
				st=df.format(double5/10000);
				breakdownDatabean2.setRightValue(st);
			}
			databeans.add(breakdownDatabean2);
			breakdownDatabean2 = new IndicatorBreakdownDatabean();
			breakdownDatabean2.setRightValue("0");
			for (IndicatorBreakdownDatabean databean2 : breakdownDatabeans) {
				if(databean2.getCurrentMonth().contains(DateForIndUtils.getNextMonthDate(breakdownDatabean.getCurrentMonth(),-12))){
					Double double6 = Double.parseDouble(databean2.getSeasonsComparison());
					Double double7 = (double5-double6)/double6*100;
					if(double7 != 0){
						st=df.format(double7);
						breakdownDatabean2.setRightValue(st);
					}
				}
			}
			databeans.add(breakdownDatabean2);
			breakdownDatabean2 = new IndicatorBreakdownDatabean();
			breakdownDatabean2.setLeftValue(breakdownDatabean.getCurrentMonth().substring(0, 4)+"."+breakdownDatabean.getCurrentMonth().substring(4));
			breakdownDatabean2.setRightdata(databeans);
			breakdownDatabeans3.add(breakdownDatabean2);
		}
		return breakdownDatabeans3;
	}

	/**
	 * 获取第三张图月份数据
	 * @param filter
	 * @return
	 * @throws ParseException
	 */
	private List<IndicatorBreakdownDatabean> getMonthValue(
			IndicatorBreakdownFilter filter) throws ParseException {
		filter = IndustryNameUtils.changeName(filter);
		filter.setDate(DateForIndUtils.getNextYearDate(filter.getDate().substring(0,4),0));
		List<IndicatorBreakdown> breakdowns = breakdownService.queryMonthAbsolute(filter);
		List<IndicatorBreakdownDatabean> breakdownDatabeans = new ArrayList<IndicatorBreakdownDatabean>();
		breakdownDatabeans = DataUtils.detailData(breakdowns,breakdownDatabeans);
		filter.setDate(DateForIndUtils.getNextYearDate(filter.getDate(),-1));
		List<IndicatorBreakdown> breakdownSs = breakdownService.queryMonthAbsolute(filter);
		breakdownDatabeans = DataUtils.detailData(breakdownSs,breakdownDatabeans);
		filter.setDate(DateForIndUtils.getNextYearDate(filter.getDate(),-1));
		breakdownSs = breakdownService.queryMonthAbsolute(filter);
		breakdownDatabeans = DataUtils.detailData(breakdownSs,breakdownDatabeans);
		List<IndicatorBreakdownDatabean> breakdownDatabeans3 = new ArrayList<IndicatorBreakdownDatabean>();
		for (IndicatorBreakdownDatabean breakdownDatabean : breakdownDatabeans) {
			List<IndicatorBreakdownDatabean> databeans = new ArrayList<IndicatorBreakdownDatabean>();
			IndicatorBreakdownDatabean breakdownDatabean2 = new IndicatorBreakdownDatabean();
			if(breakdownDatabean.getCurrentMonth().substring(0,4).contains(filter.getDate())){
				continue;
			}
			DecimalFormat df=new DecimalFormat("#.##");
			String st = "";
			Double double5 = Double.parseDouble(breakdownDatabean.getSeasonsComparison());
			if(breakdownDatabean.getCurrentMonth().contains("02")){
				double5  = double5/2;
			}
			if(IndustryNameUtils.RealOutForeignIndexId.equals(filter.getIndustryId())){
				st=df.format(double5/100);
				breakdownDatabean2.setRightValue(st);
			}else {
				st=df.format(double5/10000);
				breakdownDatabean2.setRightValue(st);
			}
			databeans.add(breakdownDatabean2);
			breakdownDatabean2 = new IndicatorBreakdownDatabean();
			breakdownDatabean2.setRightValue("0");
			for (IndicatorBreakdownDatabean databean2 : breakdownDatabeans) {
				if(databean2.getCurrentMonth().contains(DateForIndUtils.getNextMonthDate(breakdownDatabean.getCurrentMonth(),-12))){
					breakdownDatabean2 = new IndicatorBreakdownDatabean();
					Double double6 = Double.parseDouble(databean2.getSeasonsComparison());
					Double double7 = (double5-double6)/double6*100;
					if(double7 != 0){
						st=df.format(double7);
						breakdownDatabean2.setRightValue(st);
					}
				}
			}
			databeans.add(breakdownDatabean2);
			breakdownDatabean2 = new IndicatorBreakdownDatabean();
			breakdownDatabean2.setLeftValue(breakdownDatabean.getCurrentMonth().substring(0, 4)+"."+breakdownDatabean.getCurrentMonth().substring(4));
			breakdownDatabean2.setRightdata(databeans);
			breakdownDatabeans3.add(breakdownDatabean2);
		}
		return breakdownDatabeans3;
	}
	/**
	 * 第四张图
	 * @param filter
	 * @return
	 * @throws ParseException
	 */
	public Map<String, Object> queryMonthCountAbsoluteThi(
			IndicatorBreakdownFilter filter) throws ParseException {
		String oneTitle = "";
		String twoTitle = "";
		String title = "";
		TertiaryIndustry industry = tertiaryIndustryService.getById(filter.getIndustryId());
		filter = IndustryNameUtils.changeName(filter);
		List<IndicatorBreakdownDatabean> breakdownDatabeans4 = new ArrayList<IndicatorBreakdownDatabean>();
		if(CodeUtils.monthOrQuarter_mon.equals(filter.getMonthOrQuarter())){
			if("A18".equals(filter.getIndustryId())||"A19".equals(filter.getIndustryId())){
				oneTitle = "当月累计完成(万元)";
			}else{
				oneTitle = "当月累计完成("+industry.getUnit()+")";
			}
			
			twoTitle = "同比增长率(%)";
			title = industry.getIndicatorName()+"各月累计绝对值及同比增长情况";
			breakdownDatabeans4 = getMonthCountValue(filter);
		}else {
			if("A18".equals(filter.getIndustryId())||"A19".equals(filter.getIndustryId())){
				oneTitle = "当季累计完成(万元)";
			}else{
				oneTitle = "当季累计完成("+industry.getUnit()+")";
			}
			twoTitle = "同比增长率(%)";
			title = industry.getIndicatorName()+"各季度累计绝对值及同比增长情况";
			breakdownDatabeans4 = getQuarterCountValue(filter);
		}
		Map<String, Object> map32 = new HashMap<String, Object>();
		List<Map<String, String>> secTitle = new ArrayList<Map<String, String>>();
		Map<String, String> map2 = new HashMap<String, String>();
		map32.put("title", title);
		map32.put("firTitle", "时间");
		map2.put("column", oneTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", twoTitle);
		secTitle.add(map2);
		map32.put("secTitle", secTitle);
//		map32.put("left", breakdownDatabean4s);
		map32.put("data", breakdownDatabeans4);
		//临时修改
		for (IndicatorBreakdownDatabean item :breakdownDatabeans4)
		{
			if(item.getLeftValue().contains("2018"))
			{
				 List<IndicatorBreakdownDatabean> dtos = item.getRightdata();
				 dtos.get(1).setRightValue("-");
			}
		}

		return map32;
	}
	/**
	 * 第四张图季度数据
	 * @param filter
	 * @return
	 * @throws ParseException 
	 */
	private List<IndicatorBreakdownDatabean> getQuarterCountValue(
			IndicatorBreakdownFilter filter) throws ParseException {
		filter = IndustryNameUtils.changeName(filter);
		filter.setDate(DateForIndUtils.getNextYearDate(filter.getDate().substring(0,4),0));
		List<IndicatorBreakdown> breakdown3s = breakdownService.queryAbsoluteValue(filter);
		List<IndicatorBreakdownDatabean> breakdownDatabean3s = new ArrayList<IndicatorBreakdownDatabean>();
		breakdownDatabean3s = DataUtils.detailcumulativeData(breakdown3s,breakdownDatabean3s);
		filter.setDate(DateForIndUtils.getNextYearDate(filter.getDate(),-1));
		List<IndicatorBreakdown> breakdown3Ss = breakdownService.queryAbsoluteValue(filter);
		breakdownDatabean3s = DataUtils.detailcumulativeData(breakdown3Ss,breakdownDatabean3s);
		List<IndicatorBreakdownDatabean> breakdownDatabeans4 = new ArrayList<IndicatorBreakdownDatabean>();
		for (IndicatorBreakdownDatabean indicatorBreakdown : breakdownDatabean3s) {
			List<IndicatorBreakdownDatabean> breakdownDatabean4s = new ArrayList<IndicatorBreakdownDatabean>();
			IndicatorBreakdownDatabean breakdownDatabean2 = new IndicatorBreakdownDatabean();
			DecimalFormat df=new DecimalFormat("#.##");
			String st=df.format(Double.parseDouble(indicatorBreakdown.getCumulative())/10000);
			breakdownDatabean2.setRightValue(st);
			breakdownDatabean4s.add(breakdownDatabean2);
			breakdownDatabean2 = new IndicatorBreakdownDatabean();
			st = df.format(Double.parseDouble(indicatorBreakdown.getRatio()));
			breakdownDatabean2.setRightValue(st);
			breakdownDatabean4s.add(breakdownDatabean2);
			breakdownDatabean2 = new IndicatorBreakdownDatabean();
			breakdownDatabean2.setLeftValue(indicatorBreakdown.getCurrentMonth().substring(0, 4)+"."+indicatorBreakdown.getCurrentMonth().substring(4));
			breakdownDatabean2.setRightdata(breakdownDatabean4s);
			breakdownDatabeans4.add(breakdownDatabean2);
//			IndicatorBreakdownDatabean breakdownDatabean = new IndicatorBreakdownDatabean();
//			breakdownDatabean4s.add(breakdownDatabean);
		}
		return breakdownDatabeans4;
	}
	/**
	 * 第四张图月份数据
	 * @param filter
	 * @return
	 */
	private List<IndicatorBreakdownDatabean> getMonthCountValue(
			IndicatorBreakdownFilter filter) throws ParseException {
		filter = IndustryNameUtils.changeName(filter);
		filter.setDate(DateForIndUtils.getNextYearDate(filter.getDate().substring(0,4),0));
		List<IndicatorBreakdown> breakdown3s = breakdownService.queryMonthAbsolute(filter);
		List<IndicatorBreakdownDatabean> breakdownDatabean3s = new ArrayList<IndicatorBreakdownDatabean>();
		breakdownDatabean3s = DataUtils.detailcumulativeData(breakdown3s,breakdownDatabean3s);
		filter.setDate(DateForIndUtils.getNextYearDate(filter.getDate(),-1));
		List<IndicatorBreakdown> breakdown3Ss = breakdownService.queryMonthAbsolute(filter);
		breakdownDatabean3s = DataUtils.detailcumulativeData(breakdown3Ss,breakdownDatabean3s);
		List<IndicatorBreakdownDatabean> breakdownDatabeans4 = new ArrayList<IndicatorBreakdownDatabean>();
		for (IndicatorBreakdownDatabean indicatorBreakdown : breakdownDatabean3s) {
			List<IndicatorBreakdownDatabean> breakdownDatabean4s = new ArrayList<IndicatorBreakdownDatabean>();
			IndicatorBreakdownDatabean breakdownDatabean2 = new IndicatorBreakdownDatabean();
			DecimalFormat df=new DecimalFormat("#.##");
			if(IndustryNameUtils.RealOutForeignIndexId.equals(filter.getIndustryId())){
				String st=df.format(Double.parseDouble(indicatorBreakdown.getCumulative())/100);
				breakdownDatabean2.setRightValue(st);
			}else {
				String st=df.format(Double.parseDouble(indicatorBreakdown.getCumulative())/10000);
				breakdownDatabean2.setRightValue(st);
			}
			breakdownDatabean4s.add(breakdownDatabean2);
			breakdownDatabean2 = new IndicatorBreakdownDatabean();
			String st = df.format(Double.parseDouble(indicatorBreakdown.getRatio()));
			breakdownDatabean2.setRightValue(st);
			breakdownDatabean4s.add(breakdownDatabean2);
			breakdownDatabean2 = new IndicatorBreakdownDatabean();
			breakdownDatabean2.setLeftValue(indicatorBreakdown.getCurrentMonth().substring(0, 4)+"."+indicatorBreakdown.getCurrentMonth().substring(4));
			breakdownDatabean2.setRightdata(breakdownDatabean4s);
			breakdownDatabeans4.add(breakdownDatabean2);
//			IndicatorBreakdownDatabean breakdownDatabean = new IndicatorBreakdownDatabean();
//			breakdownDatabean4s.add(breakdownDatabean);
		}
		return breakdownDatabeans4;
	}
	public Map<String, Object> queryByXZValueThi(IndicatorBreakdownFilter filter) {
		filter = IndustryNameUtils.changeName(filter);
		filter.setXz("乡镇");
		List<CompletionClassification> classification2s = classificationService.queryByXZValue(filter);
		List<CompletionClassificationDatabean> classificationDatabean2s = new ArrayList<CompletionClassificationDatabean>(); 
		List<CompletionClassificationDatabean> classificationDatabeans = new ArrayList<CompletionClassificationDatabean>(); 
		Double double1 = new Double(0);
		Double double2 = new Double(0);
		Double double3 = new Double(0);
		for (CompletionClassification completionClassification : classification2s) {
			classificationDatabeans = new ArrayList<CompletionClassificationDatabean>(); 
			CompletionClassificationDatabean classification = new CompletionClassificationDatabean();
//			CompletionClassificationDatabean classification2 = new CompletionClassificationDatabean();
			classification.setRightValue(completionClassification.getPlanneValue());
			classificationDatabeans.add(classification);
			classification = new CompletionClassificationDatabean();
			classification.setRightValue(completionClassification.getActualCompletionValue());
			classificationDatabeans.add(classification);
			Double doublebs1 = Double.parseDouble(completionClassification.getActualCompletionValue());
			double1 += doublebs1;
			Double doublebs2 = Double.parseDouble(completionClassification.getPlanneValue());
			double2 += doublebs2;
			Double doublebs3 = doublebs1/doublebs2*100;
			DecimalFormat df=new DecimalFormat("#.##");
			String st=df.format(doublebs3);
			classification = new CompletionClassificationDatabean();
			if("0".equals(completionClassification.getActualCompletionValue())){
				classification.setRightValue("0");
			}else {
				classification.setRightValue(st);
			}
			classificationDatabeans.add(classification);
			classification = new CompletionClassificationDatabean();
			classification.setLeftValue(completionClassification.getCategoryDetails());
			classification.setRightdata(classificationDatabeans);
			classificationDatabean2s.add(classification);
//			classificationDatabeans.add(classification2);
		}
		double3 = double1/double2*100;
		DecimalFormat df=new DecimalFormat("#.##");
		String st=df.format(double3);
		classificationDatabeans = new ArrayList<CompletionClassificationDatabean>(); 
		CompletionClassificationDatabean classification = new CompletionClassificationDatabean();
		classification.setRightValue(Double.toString(double2));
		classificationDatabeans.add(classification);
		classification = new CompletionClassificationDatabean();
		classification.setRightValue(Double.toString(double1));
		classificationDatabeans.add(classification);
		classification = new CompletionClassificationDatabean();
		classification.setRightValue(st);
		classificationDatabeans.add(classification);
		classification = new CompletionClassificationDatabean();
		classification.setLeftValue("合计");
		classification.setRightdata(classificationDatabeans);
		classificationDatabean2s.add(classification);
//		classification = new CompletionClassificationDatabean();
//		classificationDatabeans.add(classification);
		Map<String, Object> map = new HashMap<String, Object>();
		List<Map<String, String>> secTitle = new ArrayList<Map<String, String>>();
		Map<String, String> map2 = new HashMap<String, String>();
		map.put("title", filter.getIndustryName()+"按乡镇分类完成情况");
		map.put("firTitle", "乡镇");
		String oneTitle = "年计划数(万元)";
		String twoTitle = "完成数(万元)";
		String thiTitle = "完成比率(%)";
		map2.put("column", oneTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", twoTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", thiTitle);
		secTitle.add(map2);
		map.put("secTitle", secTitle);
//		map.put("left", classificationDatabeans);
		map.put("data", classificationDatabean2s);
		return map;
	}

	public Map<String, Object> queryMonthDevelopmentSituationThi(
			IndicatorBreakdownFilter filter) throws ParseException {
		List<IndicatorBreakdownDatabean> breakdownDatabean2s = new ArrayList<IndicatorBreakdownDatabean>();
		String oneTitle = "";
		String twoTitle = "";
		String thiTitle = "";
		String fourTitle = "";
		String title = "";
		filter = IndustryNameUtils.changeName(filter);
		TertiaryIndustry industry = tertiaryIndustryService.getById(filter.getIndustryId());
		if(CodeUtils.monthOrQuarter_mon.equals(filter.getMonthOrQuarter())){
			if("A18".equals(filter.getIndustryId())||"A19".equals(filter.getIndustryId())){
				oneTitle = "当月绝对值(万元)";
				twoTitle = "当月累计绝对值(万元)";
			}else{
				oneTitle = "当月绝对值("+industry.getUnit()+")";
				twoTitle = "当月累计绝对值("+industry.getUnit()+")";
			}
			
			thiTitle = "当月同比增长率(%)";
			fourTitle = "当月累计增长率(%)";
			title = industry.getIndicatorName()+"当月同比增长情况";
			breakdownDatabean2s = queryMonthDevelopmentSituation(filter);
		}else {
			if("A18".equals(filter.getIndustryId())||"A19".equals(filter.getIndustryId())){
				oneTitle = "当季绝对值(万元)";
				twoTitle = "当季累计绝对值(万元)";
			}else{
				oneTitle = "当季绝对值("+industry.getUnit()+")";
				twoTitle = "当季累计绝对值("+industry.getUnit()+")";
			}
			
			thiTitle = "当季同比增长率(%)";
			fourTitle = "当季累计增长率(%)";
			title = industry.getIndicatorName()+"当季同比增长情况";
			breakdownDatabean2s = queryDevelopmentSituation(filter);
		}
		
//		List<IndicatorBreakdownDatabean> breakdownDatabeans = new ArrayList<IndicatorBreakdownDatabean>();
//		IndicatorBreakdownDatabean databean3 = new IndicatorBreakdownDatabean();
//		
//		breakdownDatabeans.add(databean3);
//		databean3 = new IndicatorBreakdownDatabean();
//		
//		breakdownDatabeans.add(databean3);
		Map<String, Object> map = new HashMap<String, Object>();
		List<Map<String, String>> secTitle = new ArrayList<Map<String, String>>();
		Map<String, String> map2 = new HashMap<String, String>();
		map.put("title", title);
		map.put("firTitle", "时间");
		map2.put("column", oneTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", twoTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", thiTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", fourTitle);
		secTitle.add(map2);
		map.put("secTitle", secTitle);
//		map.put("left", breakdownDatabeans);
	
		map.put("data", breakdownDatabean2s);
		return map;
	}
	private List<IndicatorBreakdownDatabean> queryDevelopmentSituation(
			IndicatorBreakdownFilter filter) throws ParseException {
		filter = IndustryNameUtils.changeName(filter);
		//String date = filter.getCurrentMonth().substring(0, 4);
		String date = filter.getCurrentMonth();
	
		List<IndicatorBreakdownDatabean> breakdownDatabean2s = new ArrayList<IndicatorBreakdownDatabean>();
		List<IndicatorBreakdown> lists2 = breakdownService.queryDevelopmentSituation(filter);
		IndicatorBreakdownDatabean databean = new IndicatorBreakdownDatabean();
		String lastDateVal = "";
		String DateVal = "";
		DecimalFormat df=new DecimalFormat("#.##");
		for (IndicatorBreakdown indicatorBreakdown : lists2) {
			if(StringUtils.equals(indicatorBreakdown.getCurrentMonth(), DateForIndUtils.getNextMonthDate(filter.getCurrentMonth(), -3))){
				lastDateVal = indicatorBreakdown.getCumulative();
			}else {
				DateVal = indicatorBreakdown.getCumulative();
				databean.setRightFou(df.format(Double.parseDouble(indicatorBreakdown.getRatio())));
				String st=df.format(Double.parseDouble(indicatorBreakdown.getCumulative())/10000);
				databean.setRightSec(st);
			}
			
		}
		Double double1 = Double.parseDouble(lastDateVal);
		Double double2 = Double.parseDouble(DateVal);
		Double double3 = double2-double1;
	    String st=df.format(double3/10000);
		databean.setRightOne(st);
		//查找去年当季和去年当月前一个月数据
		filter.setCurrentMonth(DateForIndUtils.getNextMonthDate(filter.getCurrentMonth(),-12));
		IndicatorBreakdownDatabean databean2 = new IndicatorBreakdownDatabean();
		List<IndicatorBreakdown> indicatorBreakdowns = breakdownService.queryDevelopmentSituation(filter);
		for (IndicatorBreakdown indicatorBreakdown : indicatorBreakdowns) {
			if(StringUtils.equals(indicatorBreakdown.getCurrentMonth(), DateForIndUtils.getNextMonthDate(filter.getCurrentMonth(), -3))){
				lastDateVal = indicatorBreakdown.getCumulative();
			}else {
				DateVal = indicatorBreakdown.getCumulative();
				databean2.setRightFou(df.format(Double.parseDouble(indicatorBreakdown.getRatio())));
			}
		}
		double1 = Double.parseDouble(lastDateVal);
		double2 = Double.parseDouble(DateVal);
		st=df.format(double2/10000);
		databean2.setRightSec(st);
		st=df.format((double2-double1)/10000);
		databean2.setRightOne(st);
		Double double4 = double2-double1;
		double3 =(double3-double4)/double4*100;
		if(double3 != 0){
			st=df.format(double3);
			databean.setRightThi(st);
		}
		databean.setLeftValue(date);
		databean2.setLeftValue(filter.getCurrentMonth());
		filter.setCurrentMonth(DateForIndUtils.getNextMonthDate(filter.getCurrentMonth(),-12));
		List<IndicatorBreakdown> indicatorBreakdown2s = breakdownService.queryDevelopmentSituation(filter);
		for (IndicatorBreakdown indicatorBreakdown : indicatorBreakdown2s) {
			if(StringUtils.equals(indicatorBreakdown.getCurrentMonth(), DateForIndUtils.getNextMonthDate(filter.getCurrentMonth(), -3))){
				lastDateVal = indicatorBreakdown.getCumulative();
			}else {
				DateVal = indicatorBreakdown.getCumulative();
			}
		}
		double1 = Double.parseDouble(lastDateVal);
		double2 = Double.parseDouble(DateVal);
		double4 = double2-double1;
		double3 =(double3-double4)/double4*100;
		if(double3 != 0){
			df=new DecimalFormat("#.##");
			st=df.format(double3);
			databean2.setRightThi(st);
		}
		List<IndicatorBreakdownDatabean> databeans = new ArrayList<IndicatorBreakdownDatabean>();
		IndicatorBreakdownDatabean breakdownDatabean = new IndicatorBreakdownDatabean();
		breakdownDatabean.setRightValue(databean.getRightOne());
		databeans.add(breakdownDatabean);
		breakdownDatabean = new IndicatorBreakdownDatabean();
		breakdownDatabean.setRightValue(databean.getRightSec());
		databeans.add(breakdownDatabean);
		breakdownDatabean = new IndicatorBreakdownDatabean();
		breakdownDatabean.setRightValue(databean.getRightThi());
		databeans.add(breakdownDatabean);
		breakdownDatabean = new IndicatorBreakdownDatabean();
		breakdownDatabean.setRightValue(databean.getRightFou());
		databeans.add(breakdownDatabean);
		breakdownDatabean = new IndicatorBreakdownDatabean();
		breakdownDatabean.setLeftValue(databean.getLeftValue());
		breakdownDatabean.setRightdata(databeans);
		breakdownDatabean2s.add(breakdownDatabean);

		databeans = new ArrayList<IndicatorBreakdownDatabean>();
		breakdownDatabean = new IndicatorBreakdownDatabean();
		breakdownDatabean.setRightValue(databean2.getRightOne());
		databeans.add(breakdownDatabean);
		breakdownDatabean = new IndicatorBreakdownDatabean();
		breakdownDatabean.setRightValue(databean2.getRightSec());
		databeans.add(breakdownDatabean);
		breakdownDatabean = new IndicatorBreakdownDatabean();
		if(StringUtils.isBlank(databean2.getRightThi())){
			breakdownDatabean.setRightValue("0");
		}else {
			breakdownDatabean.setRightValue(databean2.getRightThi());
		}
		databeans.add(breakdownDatabean);
		breakdownDatabean = new IndicatorBreakdownDatabean();
		breakdownDatabean.setRightValue(databean2.getRightFou());
		databeans.add(breakdownDatabean);
		breakdownDatabean = new IndicatorBreakdownDatabean();
	    breakdownDatabean.setLeftValue(databean2.getLeftValue());
		breakdownDatabean.setRightdata(databeans);
		breakdownDatabean2s.add(breakdownDatabean);
		return breakdownDatabean2s;
	}
	/**
	 * 第二张图月份数据
	 * @param filter
	 * @return
	 * @throws ParseException
	 */
	private List<IndicatorBreakdownDatabean> queryMonthDevelopmentSituation(
			IndicatorBreakdownFilter filter) throws ParseException {
		filter = IndustryNameUtils.changeName(filter);
		//String date = filter.getCurrentMonth().substring(0, 4);
		String date = filter.getCurrentMonth();
		List<IndicatorBreakdownDatabean> breakdownDatabean2s = new ArrayList<IndicatorBreakdownDatabean>();
		List<IndicatorBreakdown> lists2 = breakdownService.queryMonthDevelopmentSituation(filter);
	    IndicatorBreakdownDatabean databean = new IndicatorBreakdownDatabean();
		String lastDateVal = "";
		String DateVal = "";
		DecimalFormat df=new DecimalFormat("#.##");
		for (IndicatorBreakdown indicatorBreakdown : lists2) {
			if(StringUtils.equals(indicatorBreakdown.getCurrentMonth(), DateForIndUtils.getNextMonthDate(filter.getCurrentMonth(), -1))){
					lastDateVal = indicatorBreakdown.getCumulative();
			}else {
				DateVal = indicatorBreakdown.getCumulative();
				databean.setRightFou(df.format(Double.parseDouble(indicatorBreakdown.getRatio())));
				String st=df.format(Double.parseDouble(indicatorBreakdown.getCumulative())/10000);
				databean.setRightSec(st);
			}
			
		}
		if("".equals(lastDateVal)){
			lastDateVal="0";
		}
		Double double1 = Double.parseDouble(lastDateVal);
		Double double2 = Double.parseDouble(DateVal);
		Double double3 = double2-double1;
	
		String st = "";
		if(IndustryNameUtils.RealOutForeignIndexId.equals(filter.getIndustryId())){
			st=df.format(double3/100);
			databean.setRightOne(st);
		}else {
			st=df.format(double3/10000);
			databean.setRightOne(st);
		}
		
		//查找去年当季和去年当月前一个月数据
		filter.setCurrentMonth(DateForIndUtils.getNextMonthDate(filter.getCurrentMonth(),-12));
		IndicatorBreakdownDatabean databean2 = new IndicatorBreakdownDatabean();
		List<IndicatorBreakdown> indicatorBreakdowns = breakdownService.queryMonthDevelopmentSituation(filter);
		for (IndicatorBreakdown indicatorBreakdown : indicatorBreakdowns) {
			if(StringUtils.equals(indicatorBreakdown.getCurrentMonth(), DateForIndUtils.getNextMonthDate(filter.getCurrentMonth(), -1))){
				lastDateVal = indicatorBreakdown.getCumulative();
			}else {
				DateVal = indicatorBreakdown.getCumulative();
				databean2.setRightFou(df.format(Double.parseDouble(indicatorBreakdown.getRatio())));
			}
		}
		double1 = Double.parseDouble(lastDateVal);
		double2 = Double.parseDouble(DateVal);
		if(IndustryNameUtils.RealOutForeignIndexId.equals(filter.getIndustryId())){
			st=df.format(double2/100);
			databean2.setRightSec(st);
			st=df.format((double2-double1)/100);
			databean2.setRightOne(st);
		}else {
			st=df.format(double2/10000);
			databean2.setRightSec(st);
			st=df.format((double2-double1)/10000);
			databean2.setRightOne(st);
		}
		Double double4 = double2-double1;
		double3 =(double3-double4)/double4*100;
		if(double3 != 0){
			st=df.format(double3);
			databean.setRightThi(st);
		}
		databean.setLeftValue(date);
		
		databean2.setLeftValue(filter.getCurrentMonth());
		double3 = double2-double1;
		filter.setCurrentMonth(DateForIndUtils.getNextMonthDate(filter.getCurrentMonth(),-12));
		List<IndicatorBreakdown> indicatorBreakdown2s = breakdownService.queryMonthDevelopmentSituation(filter);
		for (IndicatorBreakdown indicatorBreakdown : indicatorBreakdown2s) {
			if(StringUtils.equals(indicatorBreakdown.getCurrentMonth(), DateForIndUtils.getNextMonthDate(filter.getCurrentMonth(), -1))){
				lastDateVal = indicatorBreakdown.getCumulative();
			}else {
				DateVal = indicatorBreakdown.getCumulative();
			}
		}
		if(ObjectUtils.isNotBlank(indicatorBreakdown2s)){
			double1 = Double.parseDouble(lastDateVal);
			double2 = Double.parseDouble(DateVal);
			double4 = double2-double1;
			double3 =(double3-double4)/double4*100;
			if(double3 != 0){
				df=new DecimalFormat("#.##");
				st=df.format(double3);
				databean2.setRightThi(st);
			}
		}
		
		List<IndicatorBreakdownDatabean> databeans = new ArrayList<IndicatorBreakdownDatabean>();
		IndicatorBreakdownDatabean breakdownDatabean = new IndicatorBreakdownDatabean();
		//当年月份

		breakdownDatabean.setRightValue(databean.getRightOne());
		databeans.add(breakdownDatabean);
		breakdownDatabean = new IndicatorBreakdownDatabean();

		breakdownDatabean.setRightValue(databean.getRightSec());
		databeans.add(breakdownDatabean);
		breakdownDatabean = new IndicatorBreakdownDatabean();
		if(ObjectUtils.isNotBlank(databean.getRightThi())){
			breakdownDatabean.setRightValue(databean.getRightThi());
		}else{
			breakdownDatabean.setRightValue("-");
		}
	
		databeans.add(breakdownDatabean);
		
		breakdownDatabean = new IndicatorBreakdownDatabean();
		breakdownDatabean.setRightValue(databean.getRightFou());
		databeans.add(breakdownDatabean);
		breakdownDatabean = new IndicatorBreakdownDatabean();
		breakdownDatabean.setLeftValue(databean.getLeftValue());
		breakdownDatabean.setRightdata(databeans);
		breakdownDatabean2s.add(breakdownDatabean);
		
		databeans = new ArrayList<IndicatorBreakdownDatabean>();
		breakdownDatabean = new IndicatorBreakdownDatabean();
		breakdownDatabean.setRightValue(databean2.getRightOne());
		databeans.add(breakdownDatabean);
		breakdownDatabean = new IndicatorBreakdownDatabean();
		breakdownDatabean.setRightValue(databean2.getRightSec());
		databeans.add(breakdownDatabean);
		breakdownDatabean = new IndicatorBreakdownDatabean();
		if(StringUtils.isBlank(databean2.getRightThi())){
			breakdownDatabean.setRightValue("0");
		}else {
			breakdownDatabean.setRightValue(databean2.getRightThi());
		}
		databeans.add(breakdownDatabean);
	    breakdownDatabean = new IndicatorBreakdownDatabean();
		breakdownDatabean.setRightValue(databean2.getRightFou());
		databeans.add(breakdownDatabean);
		if(indicatorBreakdowns.size()>0){
		breakdownDatabean = new IndicatorBreakdownDatabean();
	    breakdownDatabean.setLeftValue(databean2.getLeftValue());
		breakdownDatabean.setRightdata(databeans);
		breakdownDatabean2s.add(breakdownDatabean);
		}
		return breakdownDatabean2s;
	}
	public Map<String, Object> queryByBMValueThi(IndicatorBreakdownFilter filter) {
		filter = IndustryNameUtils.changeName(filter);
		filter.setBm("部门");
		List<CompletionClassification> classifications = classificationService.queryByValue(filter);
		List<CompletionClassificationDatabean> classificationDatabeans = new ArrayList<CompletionClassificationDatabean>(); 
//		List<CompletionClassificationDatabean> classificationDatabeans2 = new ArrayList<CompletionClassificationDatabean>(); 
		for (CompletionClassification completionClassification : classifications) {
			List<CompletionClassificationDatabean> databeans = new ArrayList<CompletionClassificationDatabean>(); 
			CompletionClassificationDatabean classification = new CompletionClassificationDatabean();
//			CompletionClassificationDatabean classification2 = new CompletionClassificationDatabean();
			classification.setRightValue(completionClassification.getPlanneValue());
			databeans.add(classification);
			classification = new CompletionClassificationDatabean();
			classification.setRightValue(completionClassification.getActualCompletionValue());
			databeans.add(classification);
			classification = new CompletionClassificationDatabean();
			Double double1 = Double.parseDouble(completionClassification.getActualCompletionValue());
			Double double2 = Double.parseDouble(completionClassification.getPlanneValue());
			Double double3 = double1/double2*100;
			if(double3 > 1){
				DecimalFormat df=new DecimalFormat("#.##");
				String st=df.format(double1/double2*100);
				classification.setRightValue(st);
			}else {
				classification.setRightValue("0");
			}
			databeans.add(classification);
			classification = new CompletionClassificationDatabean();
			classification.setLeftValue(completionClassification.getCategoryDetails());
			classification.setRightdata(databeans);
			classificationDatabeans.add(classification);
//			classificationDatabeans2.add(classification2);
		}
		Map<String, Object> map = new HashMap<String, Object>();
		List<Map<String, String>> secTitle = new ArrayList<Map<String, String>>();
		Map<String, String> map2 = new HashMap<String, String>();
		map.put("title", filter.getIndustryName()+"按部门分类完成情况");
		map.put("firTitle", "部门");
		String oneTitle = "年计划数(万元)";
		String twoTitle = "完成数(万元)";
		String thiTitle = "完成比率(%)";
		map2.put("column", oneTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", twoTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", thiTitle);
		secTitle.add(map2);
		map.put("secTitle", secTitle);
//		map.put("left", classificationDatabeans2);
		map.put("data", classificationDatabeans);
		return map;
	}

	public Map<String, Object> queryByDWValueThi(IndicatorBreakdownFilter filter) {
		filter = IndustryNameUtils.changeName(filter);
		filter.setQy("企业");
		List<CompletionClassification> classificationds = classificationService.queryByDWValue(filter);
		List<CompletionClassificationDatabean> classificationDatabeands = new ArrayList<CompletionClassificationDatabean>();
		for (CompletionClassification completionClassification : classificationds) {
			List<CompletionClassificationDatabean> databeans = new ArrayList<CompletionClassificationDatabean>();
			CompletionClassificationDatabean classification = new CompletionClassificationDatabean();
			classification.setRightValue(completionClassification.getPlanneValue());
			databeans.add(classification);
			classification = new CompletionClassificationDatabean();
			classification.setRightValue(completionClassification.getActualCompletionValue());
			databeans.add(classification);
			classification = new CompletionClassificationDatabean();
			Double doubleds1 = Double.parseDouble(completionClassification.getActualCompletionValue());
			Double doubleds2 = Double.parseDouble(completionClassification.getPlanneValue());
			Double doubleds3 = doubleds1/doubleds2*100;
			DecimalFormat df=new DecimalFormat("#.##");
			if(doubleds3 == 0){
				classification.setRightValue(Double.toString(doubleds3));
			}else {
				String st=df.format(doubleds3);
				classification.setRightValue(st);
			}
			databeans.add(classification);
			classification = new CompletionClassificationDatabean();
			classification.setRightValue("待填充");
			databeans.add(classification);
			classification = new CompletionClassificationDatabean();
			classification.setRightValue("待填充");
			databeans.add(classification);
			classification = new CompletionClassificationDatabean();
			classification.setRightValue("待填充");
			databeans.add(classification);
			classification = new CompletionClassificationDatabean();
			classification.setLeftValue(completionClassification.getCategoryDetails());
			classification.setRightdata(databeans);
			classificationDatabeands.add(classification);
//			classificationDatabeands2.add(classification2);
		}
		Map<String, Object> map = new HashMap<String, Object>();
		List<Map<String, String>> secTitle = new ArrayList<Map<String, String>>();
		Map<String, String> map2 = new HashMap<String, String>();
		map.put("title", filter.getIndustryName()+"按企业分类完成情况");
		map.put("firTitle", "企业");
		String oneTitle = "计划投资(万元)";
		String twoTitle = "完成数(万元)";
		String thiTitle = "完成比率(%)";
		String fouTitle = "分管领导";
		String fivTitle = "责任单位";
		String sixTitle = "服务内容";
		map2.put("column", oneTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", twoTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", thiTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", fouTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", fivTitle);
		secTitle.add(map2);
		map2 = new HashMap<String, String>();
		map2.put("column", sixTitle);
		secTitle.add(map2);
		map.put("secTitle", secTitle);
//		map.put("left", classificationDatabeands2);
		map.put("data", classificationDatabeands);
		return map;
	}
	public IndicatorBreakdownDatabean queryCountyRank(
			IndicatorBreakdownFilter filter) {
		List<IndicatorBreakdownDatabean> databeans = new ArrayList<IndicatorBreakdownDatabean>();
		List<IndicatorBreakdown> lists = breakdownService.queryCountyRank(filter);
		if(lists.size()<3){
			return null;
		}
		IndicatorBreakdownDatabean databeans2 = new IndicatorBreakdownDatabean();
		DecimalFormat df=new DecimalFormat("#.##");
		int i =0;
		for (IndicatorBreakdown indicatorBreakdown : lists) {

			IndicatorBreakdownDatabean databean = new IndicatorBreakdownDatabean();
			databean.setArea(indicatorBreakdown.getArea());
			databean.setRatio(df.format(Double.parseDouble(indicatorBreakdown.getRatio())));
			databean.setCumulative(df.format(Double.parseDouble(indicatorBreakdown.getCumulative())/10000));
			if(indicatorBreakdown.getArea().contains("福州市")){
				databean.setIndex(0);
				//databeans.add(0, databean);

			}else if(indicatorBreakdown.getArea().contains("永泰")){
				String st=df.format(Double.parseDouble(indicatorBreakdown.getExpectedTarget())/10000);
				databeans2.setExpectedTarget(st);
				databeans2.setArea(indicatorBreakdown.getArea());
				databean.setIndex(1);
				//databeans.add(2, databean);
			}else {
				//databeans.add(databean);
				databean.setIndex(2+i);
			}
			databeans.add(databean);
			i++;

		}
		Collections.sort(databeans, new Comparator<IndicatorBreakdownDatabean>() {
			@Override
			public int compare(IndicatorBreakdownDatabean o1, IndicatorBreakdownDatabean o2) {
				if(o1.getIndex()>o2.getIndex()){
					return 1;
				}else if(o1.getIndex()==o2.getIndex()){
					return  0;
				}else {
					return -1;
				}

			}
		});
		databeans2.setRightdata(databeans);
		return databeans2;
	}
	public List<IndicatorBreakdownDatabean> queryMonthDevelopment(
			IndicatorBreakdownFilter filter) throws ParseException {
		List<IndicatorBreakdownDatabean> breakdownDatabean2s = new ArrayList<IndicatorBreakdownDatabean>();
		List<IndicatorBreakdown> lists2 = breakdownService.queryMonthDevelopmentSituation(filter);
		//校验
		if(lists2.size()<2){
			return null;
		}
		TertiaryIndustry industries = industryService.queryByfilter(filter);
		if(ObjectUtils.isBlank(industries)){
			return null;
		}
		IndicatorBreakdownDatabean databean = new IndicatorBreakdownDatabean();
		String lastDateVal = "";
		String DateVal = "";
		for (IndicatorBreakdown indicatorBreakdown : lists2) {
			if(StringUtils.equals(indicatorBreakdown.getCurrentMonth(), DateForIndUtils.getNextMonthDate(filter.getCurrentMonth(), -1))){
				lastDateVal = indicatorBreakdown.getCumulative();
			}else {
				DateVal = indicatorBreakdown.getCumulative();
				databean.setRatio(indicatorBreakdown.getRatio());
			}
			
		}
		Double double1 = Double.parseDouble(lastDateVal);
		Double double2 = Double.parseDouble(DateVal);
		Double double3 = double2-double1;
		//查找去年当季和去年当月前一个月数据
		filter.setCurrentMonth(DateForIndUtils.getNextMonthDate(filter.getCurrentMonth(),-12));
		List<IndicatorBreakdown> indicatorBreakdowns = breakdownService.queryMonthDevelopmentSituation(filter);
		//校验
		if(indicatorBreakdowns.size()<2){
			return null;
		}
		for (IndicatorBreakdown indicatorBreakdown : indicatorBreakdowns) {
			if(StringUtils.equals(indicatorBreakdown.getCurrentMonth(), DateForIndUtils.getNextMonthDate(filter.getCurrentMonth(), -1))){
				lastDateVal = indicatorBreakdown.getCumulative();
			}else {
				DateVal = indicatorBreakdown.getCumulative();
			}
		}
		double1 = Double.parseDouble(lastDateVal);
		double2 = Double.parseDouble(DateVal);
		Double double4 = double2-double1;
		double3 =(double3-double4)/double4*100;
		databean.setCountyIncrease(industries.getCountyIncrease());
		databean.setCityIncrease(industries.getCityIncrease());
		if(double3 != 0){
			DecimalFormat df=new DecimalFormat("#.##");
			String st=df.format(double3);
			databean.setConcurrentGrowth(st);
		}
		databean.setuBIncrease(industries.getuBIncrease());
		breakdownDatabean2s.add(databean);
		return breakdownDatabean2s;
	}
	public List<Map<String, Object>> queryMonthAbsolute(
			IndicatorBreakdownFilter filter) throws ParseException {
		IndicatorBreakdown breakdown = breakdownService.queryMonthValue(filter);
		if(ObjectUtils.isBlank(breakdown)){
			return null;
		}
		filter.setDate(DateForIndUtils.getNextYearDate(filter.getDate().substring(0,4),0));
		List<IndicatorBreakdown> breakdowns = breakdownService.queryMonthAbsolute(filter);
		List<IndicatorBreakdownDatabean> breakdownDatabeans = new ArrayList<IndicatorBreakdownDatabean>();
		breakdownDatabeans = DataUtils.detailData(breakdowns,breakdownDatabeans);
		filter.setDate(DateForIndUtils.getNextYearDate(filter.getDate(),-1));
		List<IndicatorBreakdown> breakdownSs = breakdownService.queryMonthAbsolute(filter);
		DecimalFormat df=new DecimalFormat("#.##");
		breakdownDatabeans = DataUtils.detailData(breakdownSs,breakdownDatabeans);
		List<IndicatorBreakdownDatabean> breakdownDatabeans2 = new ArrayList<IndicatorBreakdownDatabean>();
		List<IndicatorBreakdownDatabean> breakdownDatabeans3 = new ArrayList<IndicatorBreakdownDatabean>();
		for (IndicatorBreakdownDatabean breakdownDatabean : breakdownDatabeans) {
			for (IndicatorBreakdownDatabean databean2 : breakdownDatabeans) {
				if(databean2.getCurrentMonth().contains(DateForIndUtils.getNextMonthDate(breakdownDatabean.getCurrentMonth(),-12))){
					Double double5 = Double.parseDouble(breakdownDatabean.getSeasonsComparison());
					Double double6 = Double.parseDouble(databean2.getSeasonsComparison());
					Double double7 = (double5-double6)/double6*100;
					if(double7 != 0){
						String st=df.format(double7);
						breakdownDatabean.setConcurrentGrowth(st);
					}
				}
			}
			breakdownDatabean.setSeasonsComparison(df.format(Double.parseDouble(breakdownDatabean.getSeasonsComparison())/10000));
			if(breakdownDatabean.getCurrentMonth().contains("2016")){
				breakdownDatabean.setCurrentMonth(breakdownDatabean.getCurrentMonth().substring(4));
				breakdownDatabeans2.add(breakdownDatabean);
			}else {
				breakdownDatabean.setCurrentMonth(breakdownDatabean.getCurrentMonth().substring(4));
				breakdownDatabeans3.add(breakdownDatabean);
			}
		}
		List<Map<String, Object>> list = new ArrayList<Map<String,Object>>();
		Map<String, Object> map2 = new HashMap<String, Object>();
		Collections.reverse(breakdownDatabeans2);
		Collections.reverse(breakdownDatabeans3);
		map2.put("lastYear", breakdownDatabeans2);
		map2.put("years", breakdownDatabeans3);
		list.add(map2);
		return list;
	}
	public List<Map<String, Object>> queryLJAbsolute(
			IndicatorBreakdownFilter filter) throws ParseException {
		IndicatorBreakdown breakdown = breakdownService.queryMonthValue(filter);
		if(ObjectUtils.isBlank(breakdown)){
			return null;
		}
		filter.setDate(DateForIndUtils.getNextYearDate(filter.getDate().substring(0,4),0));
//		filter.setDate(DateForIndUtils.getNextYearDate(date.substring(0,4),0));
		List<IndicatorBreakdown> breakdown3s = breakdownService.queryMonthAbsolute(filter);
		if(ObjectUtils.isBlank(breakdown3s)){
			return null;
		}
		DecimalFormat df=new DecimalFormat("#.##");
		List<IndicatorBreakdownDatabean> breakdownDatabean3s = new ArrayList<IndicatorBreakdownDatabean>();
		breakdownDatabean3s = DataUtils.detailcumulativeData(breakdown3s,breakdownDatabean3s);
		filter.setDate(DateForIndUtils.getNextYearDate(filter.getDate(),-1));
		List<IndicatorBreakdown> breakdown3Ss = breakdownService.queryMonthAbsolute(filter);
		if(ObjectUtils.isBlank(breakdown3Ss)){
			return null;
		}
		breakdownDatabean3s = DataUtils.detailcumulativeData(breakdown3Ss,breakdownDatabean3s);
		Map<String, Object> map = new HashMap<String, Object>();
		List<IndicatorBreakdownDatabean> breakdownDatabean4s = new ArrayList<IndicatorBreakdownDatabean>();
		List<IndicatorBreakdownDatabean> breakdownDatabeans4 = new ArrayList<IndicatorBreakdownDatabean>();
		for (IndicatorBreakdownDatabean indicatorBreakdown : breakdownDatabean3s) {
			indicatorBreakdown.setCumulative(df.format(Double.parseDouble(indicatorBreakdown.getCumulative())/10000));
			if(indicatorBreakdown.getCurrentMonth().contains(filter.getDate().substring(0,4))){
				indicatorBreakdown.setCurrentMonth(indicatorBreakdown.getCurrentMonth().substring(4));
				breakdownDatabean4s.add(indicatorBreakdown);
			}else {
				indicatorBreakdown.setCurrentMonth(indicatorBreakdown.getCurrentMonth().substring(4));
				breakdownDatabeans4.add(indicatorBreakdown);
			}
		}
		List<Map<String, Object>> list32 = new ArrayList<Map<String,Object>>();
		Map<String, Object> map32 = new HashMap<String, Object>();
		Collections.reverse(breakdownDatabean4s);
		Collections.reverse(breakdownDatabeans4);
		map32.put("years",breakdownDatabeans4);
		map32.put("lastYear", breakdownDatabean4s);
		String st= "";
		if(StringUtils.isNotBlank(breakdown3s.get(0).getExpectedTarget())){
			st=df.format(Double.parseDouble(breakdown3s.get(0).getExpectedTarget())/10000);
		}
		map32.put("expectedTarget", st);
		list32.add(map32);
		return list32;
	}
	public List<CompletionClassificationDatabean> queryByXZValue(
			IndicatorBreakdownFilter filter) {
		List<CompletionClassification> classification2s = classificationService.queryByXZValue(filter);
		if(ObjectUtils.isBlank(classification2s)){
			return null;
		}
		List<CompletionClassificationDatabean> classificationDatabean2s = new ArrayList<CompletionClassificationDatabean>(); 
		DecimalFormat df=new DecimalFormat("#.##");
		for (CompletionClassification completionClassification : classification2s) {
			CompletionClassificationDatabean classification = new CompletionClassificationDatabean();
			classification.setActualCompletionValue(completionClassification.getActualCompletionValue());
			classification.setPlanneValue(completionClassification.getPlanneValue());
			classification.setCategoryDetails(completionClassification.getCategoryDetails());
			Double doublebs1 = Double.parseDouble(completionClassification.getActualCompletionValue());
			Double doublebs2 = Double.parseDouble(completionClassification.getPlanneValue());
			Double doublebs3 = doublebs1/doublebs2*100;
			if(doublebs3<DataUtils.warning(filter)){
				classification.setYujz("0");
			}else {
				classification.setYujz("1");
			}
			String st=df.format(doublebs3);
			if("0".equals(completionClassification.getActualCompletionValue())){
				classification.setCompleteAnnual("0");
			}else {
				classification.setCompleteAnnual(st);
			}
			classification.setSysId(completionClassification.getSysId());
			classification.setWarningContents(completionClassification.getWarningContents());
			classificationDatabean2s.add(classification);
		}
		Collections.sort(classificationDatabean2s, new ComparatorsUtils()); 
		return classificationDatabean2s;
	}
	public List<CompletionClassificationDatabean> queryByValue(
			IndicatorBreakdownFilter filter) {
		List<CompletionClassification> classifications = classificationService.queryByValue(filter);
		if(ObjectUtils.isBlank(classifications)){
			return null;
		}
		List<CompletionClassificationDatabean> classificationDatabeans = new ArrayList<CompletionClassificationDatabean>(); 
		DecimalFormat df=new DecimalFormat("#.##");
		for (CompletionClassification completionClassification : classifications) {
			CompletionClassificationDatabean classification = new CompletionClassificationDatabean();
			/*if(completionClassification.getActualCompletionValue().length()>4&&completionClassification.getPlanneValue().length()>4){
				classification.setActualCompletionValue(completionClassification.getActualCompletionValue().substring(0, completionClassification.getActualCompletionValue().length()-4)+
						"."+completionClassification.getActualCompletionValue().substring(completionClassification.getActualCompletionValue().length()-4, completionClassification.getActualCompletionValue().length()-3));
				classification.setPlanneValue(completionClassification.getPlanneValue().substring(0, completionClassification.getPlanneValue().length()-4)+
						"."+completionClassification.getPlanneValue().substring(completionClassification.getPlanneValue().length()-4, completionClassification.getPlanneValue().length()-3));
			}else {
				continue;
			}*/

			classification.setActualCompletionValue(df.format(Double.parseDouble(completionClassification.getActualCompletionValue())/10000));
			classification.setPlanneValue(df.format(Double.parseDouble(completionClassification.getPlanneValue())/10000));
			Double doublebs1 = Double.parseDouble(completionClassification.getActualCompletionValue());
			Double doublebs2 = Double.parseDouble(completionClassification.getPlanneValue());
			Double doublebs3 = doublebs1/doublebs2*100;
			if(doublebs3<DataUtils.warning(filter)){
				classification.setYujz("0");
			}else {
				classification.setYujz("1");
			}
			String st=df.format(doublebs3);
			classification.setSysId(completionClassification.getSysId());
			classification.setWarningContents(""+completionClassification.getWarningContents());
			classification.setCompleteAnnual(st);
			classification.setCategoryDetails(completionClassification.getCategoryDetails());
			classificationDatabeans.add(classification);
		}
		Collections.sort(classificationDatabeans, new ComparatorsUtils());
		List<CompletionClassificationDatabean> classificationDatabeans2 = new ArrayList<CompletionClassificationDatabean>(); 
		int k = 10;
		if(classificationDatabeans.size()<10){
			k = classificationDatabeans.size();
		}
		
		for (int i = 0; i < k; i++) {
			classificationDatabeans2.add(classificationDatabeans.get(i));
		}
		
		return classificationDatabeans2;
	}
	public List<Map<String, Object>> queryByHYValue(
			IndicatorBreakdownFilter filter) {
		List<CompletionClassification> classificationa = classificationService.queryMonthValue(filter);
		if(ObjectUtils.isBlank(classificationa)){
			return null;
		}
		List<CompletionClassification> classification3s = classificationService.queryByHYValue(filter);
		List<CompletionClassificationDatabean> classificationDatabean3s = new ArrayList<CompletionClassificationDatabean>(); 
		List<CompletionClassificationDatabean> classificationDatabean4s = new ArrayList<CompletionClassificationDatabean>(); 
		DecimalFormat df=new DecimalFormat("#.##");
		for (CompletionClassification completionClassification : classification3s) {
			CompletionClassificationDatabean classification = new CompletionClassificationDatabean();
			if("项目投资".equals(completionClassification.getCategoryDetails())){
				classification.setActualCompletionValue(completionClassification.getActualCompletionValue().substring(0, completionClassification.getActualCompletionValue().length()-4));
				classification.setPlanneValue(completionClassification.getPlanneValue());
				classification.setCategoryDetails(completionClassification.getCategoryDetails());
				classification.setCompleteAnnual(completionClassification.getCompleteAnnual());
				classification.setCompletionPeriod(completionClassification.getCompletionPeriod().substring(4));
				classificationDatabean3s.add(classification);
			}else {
				classification.setActualCompletionValue(completionClassification.getActualCompletionValue().substring(0, completionClassification.getActualCompletionValue().length()-4));
				classification.setPlanneValue(completionClassification.getPlanneValue());
				classification.setCategoryDetails(completionClassification.getCategoryDetails());
				classification.setCompleteAnnual(completionClassification.getCompleteAnnual());
				classification.setCompletionPeriod(completionClassification.getCompletionPeriod().substring(4));
				classificationDatabean4s.add(classification);
			}
		}
		List<Map<String, Object>> list2 = new ArrayList<Map<String,Object>>();
		Map<String, Object> map3s = new HashMap<String, Object>();
		map3s.put("xmtz", classificationDatabean3s);
		map3s.put("fdctz", classificationDatabean4s);
		String st=df.format(Double.parseDouble(classification3s.get(0).getPlanneValue())/10000);
		map3s.put("expectedTarget", st);
		list2.add(map3s);
		return list2;
	}
	public List<Map<String, Object>> queryByDWValue(
			IndicatorBreakdownFilter filter) {
		List<CompletionClassification> classificationds = classificationService.queryByDWValue(filter);
		if(ObjectUtils.isBlank(classificationds)){
			return null;
		}
		List<CompletionClassificationDatabean> classificationDatabeands = new ArrayList<CompletionClassificationDatabean>(); 
		DecimalFormat df=new DecimalFormat("#.##");
		for (CompletionClassification completionClassification : classificationds) {
			CompletionClassificationDatabean classification = new CompletionClassificationDatabean();
			classification.setActualCompletionValue(completionClassification.getActualCompletionValue());
			classification.setPlanneValue(completionClassification.getPlanneValue());
			Double doubleds1 = Double.parseDouble(completionClassification.getActualCompletionValue());
			Double doubleds2 = Double.parseDouble(completionClassification.getPlanneValue());
			if(doubleds2<5000){
				continue;
			}
			Double doubleds3 = doubleds1/doubleds2*100;
			if(doubleds3<DataUtils.warning(filter)){
				classification.setYujz("0");
			}else {
				classification.setYujz("1");
			}
			if(doubleds3 == 0){
				classification.setCompleteAnnual(Double.toString(doubleds3));
			}else {
				String st=df.format(doubleds3);
				classification.setCompleteAnnual(st);
			}
			classification.setCategoryDetails(completionClassification.getCategoryDetails());
			classificationDatabeands.add(classification);
		}
		Collections.sort(classificationDatabeands, Comparators.getComparator()); 
		List<CompletionClassificationDatabean> classificationDatabeands2 = new ArrayList<CompletionClassificationDatabean>(); 
		List<CompletionClassificationDatabean> classificationDatabeands3 = new ArrayList<CompletionClassificationDatabean>();
		for (int i = 0; i < classificationDatabeands.size(); i++) {
			int y = classificationDatabeands.size();
			if(i == 6){
				break;
			}
			classificationDatabeands2.add(classificationDatabeands.get(i));
			classificationDatabeands3.add(classificationDatabeands.get(y-i-1));
		}
		List<Map<String, Object>> listd2 = new ArrayList<Map<String,Object>>();
		Map<String, Object> mapd3s = new HashMap<String, Object>();
		mapd3s.put("qliu", classificationDatabeands2);
		mapd3s.put("mliu", classificationDatabeands3);
		listd2.add(mapd3s);
		return listd2;
	}
	public Map<String, Object> queryLastThiValue(IndicatorBreakdownFilter filter) {
		TertiaryIndustry industry = tertiaryIndustryService.getById(filter.getIndustryId());
		if(IndustryNameUtils.ProOneIndexId.equals(filter.getIndustryId())&&"行业".equals(filter.getBm())){
			filter.setDate("201601-12");
		}
		List<CompletionClassification> classifications = classificationService.queryByThiValue(filter);
		List<CompletionClassificationDatabean> classificationDatabeans = new ArrayList<CompletionClassificationDatabean>(); 
//		List<CompletionClassificationDatabean> classificationDatabeans2 = new ArrayList<CompletionClassificationDatabean>(); 
		DecimalFormat df=new DecimalFormat("#.##");
		for (CompletionClassification completionClassification : classifications) {
			List<CompletionClassificationDatabean> databeans = new ArrayList<CompletionClassificationDatabean>(); 
			CompletionClassificationDatabean classification = new CompletionClassificationDatabean();
			if(!"A13".equals(filter.getIndustryId())){
				if(StringUtils.isNotBlank(completionClassification.getPlanneValue())){
					classification.setRightValue(df.format(Double.parseDouble(completionClassification.getPlanneValue())));
				}else {
					classification.setRightValue("待填充");
				}
			}else{
				if(StringUtils.isNotBlank(completionClassification.getCompleteAnnual())){
					classification.setRightValue(df.format(Double.parseDouble(completionClassification.getCompleteAnnual())));
				}else {
					classification.setRightValue("待填充");
				}
			}
			 if("A04".equals(filter.getIndustryId()))
			{
				classification.setRightValue(StringUtils.isNotBlank(completionClassification.getCumulativeCapital()) ? completionClassification.getCumulativeCapital():"待填充"  );
			}
			databeans.add(classification);
			classification = new CompletionClassificationDatabean();
			if(StringUtils.isNotBlank(completionClassification.getActualCompletionValue())){
				classification.setRightValue(df.format(Double.parseDouble(completionClassification.getActualCompletionValue())));
			}else {
				classification.setRightValue("待填充");
			}
			databeans.add(classification);


			classification = new CompletionClassificationDatabean();
			if(!"A13".equals(filter.getIndustryId())){
			 if(StringUtils.isNotBlank(completionClassification.getPlanneValue())&&StringUtils.isNotBlank(completionClassification.getActualCompletionValue())){
				Double double1 = Double.parseDouble(completionClassification.getActualCompletionValue());
				Double double2 = Double.parseDouble(completionClassification.getPlanneValue());
				Double double3 = double1/double2*100;
				if(double3 > 1){
					String st=df.format(double1/double2*100);
					classification.setRightValue(st);
				}else {
					classification.setRightValue("0");
				}
			}else {
				classification.setRightValue("待填充");
			}
			}else{
			if(StringUtils.isNotBlank(completionClassification.getSpecificIncrease())){
				classification.setRightValue(df.format(Double.parseDouble(completionClassification.getSpecificIncrease())));
			}else{
				classification.setRightValue("待填充");
			}
			}

			if("A04".equals(filter.getIndustryId().trim()))
			{
				classification.setRightValue(StringUtils.isNotBlank(completionClassification.getCummlativeOut()) ? completionClassification.getCummlativeOut ():"待填充"  );
			}
			databeans.add(classification);
			/*classification = new CompletionClassificationDatabean();
			classification.setRightValue(completionClassification.getStorageSituation());
			databeans.add(classification);*/
			if("A05".equals(filter.getIndustryId()))
            {

               Integer cuurentyear =Integer.parseInt (filter.getCurrentMonth().substring(0,filter.getCurrentMonth().length()-2));
               Integer lastYear = cuurentyear-1;
              	String last  =lastYear.toString()+"01-"+filter.getCurrentMonth().substring(filter.getCurrentMonth().length()-2,filter.getCurrentMonth().length());
              	filter.setDate(last);
              	filter.setCaDetails(completionClassification.getCategoryDetails().trim());
				List<CompletionClassification> lastClassfication = classificationService.queryByThiValue(filter);

                classification = new CompletionClassificationDatabean();
                classification.setRightValue(lastClassfication.size()==0?"0":lastClassfication.get(0).getActualCompletionValue());
                databeans.add(classification);

				classification = new CompletionClassificationDatabean();
				classification.setRightValue(ObjectUtils.isBlank(completionClassification.getCumulative())?"待填充":completionClassification.getCumulative());
				logger.info("最右:"+classification.getRightValue());
				databeans.add(classification);

            }
			classification = new CompletionClassificationDatabean();
			classification.setLeftValue(completionClassification.getCategoryDetails());
			classification.setRightdata(databeans);
			/*if("A05".equals(filter.getIndustryId()))   //A05多返回累计产值。
			{

				classification = new CompletionClassificationDatabean();
                classification.setRightValue(completionClassification.getActualCompletionValue());
				classification.setRightdata(databeans);
				//System.out.println("累计产值"+completionClassification.getActualCompletionValue());
				logger.info("累计产值"+completionClassification.getActualCompletionValue());
			}*/
			classificationDatabeans.add(classification);
//			classificationDatabeans2.add(classification2);
		}
		Map<String, Object> map = new HashMap<String, Object>();
		List<Map<String, String>> secTitle = new ArrayList<Map<String, String>>();
		Map<String, String> map2 = new HashMap<String, String>();
		map.put("title", industry.getIndicatorName()+"按"+filter.getBm()+"分类完成情况");
		map.put("firTitle", filter.getBm());
		if("A13".equals(filter.getIndustryId())){
			String oneTitle = "去年同期数(万元)";
			String twoTitle = "完成数(万元)";
			String thiTitle = "增速(%)";
			map2.put("column", oneTitle);
			secTitle.add(map2);
			map2 = new HashMap<String, String>();
			map2.put("column", twoTitle);
			secTitle.add(map2);
			map2 = new HashMap<String, String>();
			map2.put("column", thiTitle);
			secTitle.add(map2);
		}if("A04".equals(filter.getIndustryId().trim()))
		{
			String oneTitle = "总产值(福州)";
			String twoTitle = "总产值(千元)";
			String thiTitle = "总产值(外省)";
			map2.put("column", oneTitle);
			secTitle.add(map2);
			map2 = new HashMap<String, String>();
			map2.put("column", twoTitle);
			secTitle.add(map2);
			map2 = new HashMap<String, String>();
			map2.put("column", thiTitle);
			secTitle.add(map2);
		}else
			{
			String oneTitle = "年计划数(万元)";
			String twoTitle = "完成数(万元)";
			String thiTitle = "完成比率(%)";
			
			map2.put("column", oneTitle);
			secTitle.add(map2);
			map2 = new HashMap<String, String>();
			map2.put("column", twoTitle);
			secTitle.add(map2);
			map2 = new HashMap<String, String>();
			map2.put("column", thiTitle);
			secTitle.add(map2);
			if("A07".equals(filter.getIndustryId())){
			String stateTitle = "状态";
			map2 = new HashMap<String, String>();
			map2.put("column", stateTitle);
			secTitle.add(map2);
			}
			if("A05".equals(filter.getIndustryId().trim()))
			{
				String stateTitle = "去年同期值";
				map2 = new HashMap<String, String>();
				map2.put("column", stateTitle);
				secTitle.add(map2);

				 stateTitle = "累计值";
				map2 = new HashMap<String, String>();
				map2.put("column", stateTitle);
				secTitle.add(map2);

			}
		}
		map.put("secTitle", secTitle);
//		map.put("left", classificationDatabeans2);
		map.put("data", classificationDatabeans);
		return map;
	}
	public List<CompletionClassificationDatabean> queryXMValue(
			IndicatorBreakdownFilter filter) {
		List<CompletionClassification> classificationds = classificationService.queryByValue(filter);
		if(ObjectUtils.isBlank(classificationds)){
			return null;
		}
//		filter.setDate(DateForIndUtils.getNextMonthValueDate(filter.getDate(), -12));
//		List<CompletionClassification> classificationd2s = classificationService.queryByDWValue(filter);
		int k = 0;
		List<CompletionClassificationDatabean> classificationDatabeands = new ArrayList<CompletionClassificationDatabean>(); 
		for (int i = filter.getPage()*20; i < classificationds.size(); i++) {
			if(k == 20){
				break;
			}
//			for (CompletionClassification completionClassification2 : classificationd2s) {
//				if(completionClassification.getCategoryDetails().equals(completionClassification2.getCategoryDetails())){
					CompletionClassificationDatabean classification = new CompletionClassificationDatabean();
					DecimalFormat df=new DecimalFormat("#.##");
				    classification.setActualCompletionValue(df.format(Double.parseDouble(classificationds.get(i).getActualCompletionValue())));
					classification.setPlanneValue(df.format(Double.parseDouble(classificationds.get(i).getPlanneValue())));
					classification.setCategoryDetails(classificationds.get(i).getCategoryDetails());
//					classification.setCompleteAnnual(df.format(Double.parseDouble(classificationds.get(i).getCompleteAnnual())));
					if(Double.parseDouble(classificationds.get(i).getActualCompletionValue()) == 0|| Double.parseDouble(classificationds.get(i).getPlanneValue()) == 0){
						classification.setCompleteAnnual("0");
					}else{
						String st = df.format(Double.parseDouble(classificationds.get(i).getActualCompletionValue())/Double.parseDouble(classificationds.get(i).getPlanneValue())*100);
						classification.setCompleteAnnual(st);
					}
					
					classificationDatabeands.add(classification);
					k++;
//				}
//			}
		}
		return classificationDatabeands;
	}

}
